#include <cstdio>

typedef unsigned long long ull;
const int N = 1e6 + 5, bit = 31;
int n, k, tot, ch[2][N * (bit + 1)], a[N];
ull siz[N * (bit + 1)], ans;

inline void insert(int x) {
  int cur = 0;
  for (int i = bit - 1, tarbit; ~i; --i) {
    tarbit = (x >> i) & 1;
    if (!ch[tarbit][cur]) { ch[tarbit][cur] = ++tot; }
    cur = ch[tarbit][cur];
    ++siz[cur];
  }
}

inline ull query(int x) {
  ull res = 0;
  int cur = 0;
  bool flag = true;
  for (int i = bit - 1; ~i; --i) {
    if ((k >> i) & 1) {
      if ((x >> i) & 1) {
        if (ch[0][cur]) cur = ch[0][cur];
        else {
          flag = false;
          break;
        }
      } else {
        if (ch[1][cur]) cur = ch[1][cur];
        else {
          flag = false;
          break;
        }
      }
    } else {
      if ((x >> i) & 1) {
        res += siz[ch[0][cur]];
        if (ch[1][cur]) cur = ch[1][cur];
        else {
          flag = false;
          break;
        }
      } else {
        res += siz[ch[1][cur]];
        if (ch[0][cur]) cur = ch[0][cur];
        else {
          flag = false;
          break;
        }
      }
    }
  }
  return res + (flag ? siz[cur] : 0);
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("xor.in", "r", stdin);
  freopen("xor.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    a[i] ^= a[i - 1];
  }
  insert(0);
  for (int i = 1; i <= n; ++i) {
    ans += query(a[i]);
    insert(a[i]);
  }
  printf("%llu", ans);
  return 0;
}